<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>滨海基金 - 修改密码</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/font-awesome.min.css" rel="stylesheet">
<link href="css/animate.min.css" rel="stylesheet">
<link href="css/style.min.css" rel="stylesheet">
<!-- <base target="_blank"> -->
<link href="css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
<script src="js/plugins/sweetalert/sweetalert.min.js"></script>
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/content.min.js"></script>
<script src="js/plugins/validate/jquery.validate.min.js"></script>
<script src="js/plugins/validate/messages_zh.min.js"></script>
<script src="js/demo/form-validate-demo.min.js"></script>
<script type="text/javascript"
	src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
	<script src="js/common.js"></script>
</head>
<body class="gray-bg">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-title">
						<h5>修改密码</h5>

					</div>
					<div class="ibox-content">
						<form class="form-horizontal m-t" id="signupForm">
							<div class="form-group">
								<label class="col-sm-3 control-label">用户名：</label>
								<div class="col-sm-8">
									<input id="email" name="email" class="form-control" type="text"
										value="${loginUser.name }" disabled="disabled">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">账号：</label>
								<div class="col-sm-8">
									<input id="username" name="username" class="form-control"
										type="text" value="${loginUser.employeeId }"
										disabled="disabled">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">原密码：</label>
								<div class="col-sm-8">
									<input id="relpwd" name="relpwd" class="form-control"
										type="password">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">新密码：</label>
								<div class="col-sm-8">
									<input id="password" name="password" class="form-control"
										type="password">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">确认新密码：</label>
								<div class="col-sm-8">
									<input id="confirm_password" name="confirm_password"
										class="form-control" type="password"> <span
										class="help-block m-b-none"><i
										class="fa fa-info-circle"></i> 请再次输入您的密码</span>
								</div>
							</div>
							<div class="form-group">
								<div class="col-sm-8 col-sm-offset-3">
									<button class="btn btn-primary" id="btnSubmit" type="button">提交</button>
								</div>
							</div>
						</form>
					</div>
			</div>
		</div>
	</div>
	<script type="text/javascript">
	$("#btnSubmit").click(function() { //“登录”按钮单击事件
		//获取用户名称
		var relpwd = $("#relpwd").val();
		var password = $("#password").val();
		var confirm_password = $("#confirm_password").val();
		if(confirm_password !="" && password!=""){
		$.ajax({
			url : "changePassword.do",
			type: "post",
			data: {password:password,relpwd:relpwd},
			async : false,
			error : function(request) {
				swal("修改失败!", "密码修改提示!", "error");
			}, 
			success : function(data) {
				if (data == 1){
					swal("修改成功!", "密码修改提示!", "success");
				}else if(data == 2){
					swal("您输入的密码不正确!", "密码修改提示!", "error");
				}else{
					swal("修改失败!", "密码修改提示!", "error");
				}
				$('#signupForm')[0].reset();
			}
		});
		}else{
			swal("请填写新密码!", "密码修改提示!", "error");
		}
	});
</script>
</body>
</html>